#!/bin/bash
cd ..
source ./set_env.bash
cd -

aicl_version="AICLCA v1.0"

cur_dateTime=$(date -d "now" +"%Y-%m-%d_%H:%M:%S")
echo $cur_dateTime
echo ${PYTHONHOME}

if [ ${1} = "html" ]
then
   echo "report mode : html"
   report_mode="--html=report/report_${cur_dateTime}.html --self-contained-html --capture=sys"
else
   echo "report mode : print"
   report_mode=""
fi

if [[ -n ${3} ]];
then
   echo "test mode : specified case ${3}"
   specified_case="::${3}"
   specified_module="::${2}"
elif [[ -n ${2} ]];
then
   echo "test mode : specified module ${2}"
   specified_module="::${2}"
else
   echo "test mode : all "
fi
echo "aicl_version : ${aicl_version}"

${PYTHONHOME}/bin/pytest opencnn_api_test.py${specified_module}${specified_case}  -vs  ${report_mode}
